package com.example;
 
import com.example.service.UserService;
import org.example.spring.AnnotationConfigApplicationContext;
import org.example.spring.ApplicationContext;
/**
 * @version 1.0
 */
public class IOCExample {
 
    public static void main(String[] args) throws ClassNotFoundException {
        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(SpringConfig.class);
 
        Object userService = applicationContext.getBean(UserService.class);
        Object userMapper = applicationContext.getBean("userMapper");
 
        System.out.println(userService);
        System.out.println(userMapper);
    }
 
}